﻿using System;

namespace OccupierArchiver.DataClasses
{
    internal class MessageDto
    {
        public MessageDto()
        {
            Id = null;
            Name = "";
            Location = "";
            Message = "";
        }

        public MessageDto(string name, string location, string message)
        {
            Id = null;
            Name = name;
            Location = location;
            Message = message;
        }

        public MessageDto(int id, string name, string location, string message)
        {
            Id = id;
            Name = name;
            Location = location;
            Message = message;
        }

        public int? Id { get; set; }
        public string Name { get; set; }
        public string Location { get; set; }
        public string Message { get; set; }

        public bool IsValid()
        {
            var flag = true;
            if (String.IsNullOrWhiteSpace(Name)) flag = false;
            if (String.IsNullOrWhiteSpace(Location)) flag = false;
            if (String.IsNullOrWhiteSpace(Message)) flag = false;
            return flag;
        }

        public object[] ToArray()
        {
            return new object[] { Id, Name, Location, Message };
        }
    }
}
